import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: "/", // 默认hash值路径
    redirect: "/wyregisterS" // 重定向到
  },
  {
    //首页
    path: '/index',
    name: 'index',
    component: () => import('@/views/index.vue'),
    meta: {
      showFooter: true
    }
  },
  {
    //订单
    path: '/order',
    name: 'order',
    component: () => import('@/views/order.vue'),
    meta: {
      showFooter: true
    }
  },
  {
    //个人
    path: '/profile',
    name: 'profile',
    component: () => import('@/views/profile.vue'),
    meta: {
      showFooter: true
    }
  },
  {
    //搜索
    path: '/search',
    name: 'search',
    component: () => import('@/views/search.vue'),
    meta: {
      showFooter: true
    }
  },
  {
    //商品类型列表
    path: '/goodTypeList',
    name: 'goodTypeList',
    component: () => import('@/views/goodTypeList.vue'),
  },
  {
    //商品类型列表
    path: '/goodsmenu',
    name: 'goodsmenu',
    component: () => import('@/views/goodsmenu.vue'),
    // 默认跳转
    redirect: '/goodsmenu/elegoodcom',
    // 二级路由
    children: [
      {
        path: 'elegoodcom',
        component: () => import('@/components/elegoodCom.vue'),
      },
      {
        path: 'elegoodappraise',
        component: () => import('@/components/elegoodAppraise.vue'),
      }
    ]
  },
  {  //登录 
    path: '/wyregisterS',
    component: () => import('../views/wyregisterS.vue')
  },
  { // 商品详情
    path: '/goosDetails',
    name: 'goosDetails',
    component: () => import('../views/goosDetails.vue')
  },
  {
    //确认订单
    path: '/orderfrom',
    name: 'orderfrom',
    component: () => import('@/views/orderfrom.vue'),
  },
  {
    //商家详情
    path: '/particulars',
    name: 'particulars',
    component: () => import('@/views/particulars.vue'),
    meta: {
      showFooter: true
    }
  },
  {
    //城市主页
    path: '/home',
    component: () => import('@/views/home.vue'),
  },
  {
    //城市搜索
    path: '/city',
    component: () => import('@/views/city.vue'),
  },
  //服务中心
  {
    path: '/reseTpasswords',
    component: () => import('../views/reseTpasswords.vue'),
  },
  {
    path: '/second',
    component: () => import('../views/second.vue')
  }, {

    path: '/replacement',
    name: "replacement",
    component: () => import('../views/replacement.vue')
  }
]
const router = new VueRouter({
  routes
})
export default router
